<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .car {
            width: 100px;
            height: 40px;
            background: yellow;
            border-right: 20px solid #000;
            border-radius: 0 10px 10px 0;
            position: relative;
            /* alternate 反向   需要和infinite一起使用 */
            /* animation: car 3s cubic-bezier(.67, .01, .31, .97) alternate infinite; */
            animation: car 3s;
        }

        .car:before {
            content: 'X';
            width: 20px;
            height: 20px;
            background-color: #000;
            position: absolute;
            left: 20px;
            bottom: -15px;
            border-radius: 50%;
            color: #fff;
            text-align: center;
            animation: lun 1s infinite linear;
        }

        .car:after {
            content: 'X';
            width: 20px;
            height: 20px;
            background-color: #000;
            position: absolute;
            left: 70px;
            bottom: -15px;
            border-radius: 50%;
            color: #fff;
            text-align: center;
            animation: lun 1s infinite linear;
        }


        @keyframes lun {
            0% {
                transform: rotate(0);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        @keyframes car {
            0% {
                transform: translate(0);
            }

            50% {
                transform: translate(1000px);
            }

            51% {
                transform: translate(1000px) rotateY(180deg);
            }

            100% {
                transform: translate(0) rotateY(180deg);

            }
        }
    </style>
</head>

<body>
    <div class="car"></div>
</body>

</html>